from django.shortcuts import render
from django.http import HttpResponse
from .models import Grade,Student

# Create your views here.


def show(request,s_id):
    print(s_id)
    print(type(s_id))
    return HttpResponse(f'你好你访问了数值{s_id}')


def aaa(request, info):
    print(info)
    print(type(info))
    return HttpResponse(f'你好你访问了{info}')


def get_grade(request):
    getlist = Grade.objects.all()
    return render(request, 'myapp/index.html', context=locals())


def get_student(request, grand_id):
    get_list = Student.objects.filter(grade=grand_id)
    return render(request, 'myapp/show_student.html', context=locals())